<template>
	<view>
          <!-- <vant-button type="primary">111</vant-button>j -->
		<view class="amount">
			<text>￥</text>{{testlist.price*showInfor1.length}}
		</view>
		<view class="pay-tips">支付金额</view>
		<view class="pay-info-item">
			<view class="film-title">{{info.name}}</view>
			<view class="film-text">{{info1.name}}</view>
			<view class="film-text">{{info1.city}}{{info1.area}}{{info1.address}}</view>
		
			<view class="film-text">
				<text v-for="(value,index) in showInfor1" :key="index">{{value.seatName}},</text>
			</view>
		</view>
		<view class="pay-btns" @click="gotomoviepay">去支付</view>

	</view>
</template>

<script>
	import {
		movieticket,
		theatretimes,
		filmdetail,
		moviedetail,
		ticketlist
	
	} from "../../../api/movieService.js";
	import{baseurl} from '../../../api/request.js';
	
	import {
		moviesessions,
		moviedetails,
		moviecinema
	} from "../../../mock/movie.js";
	
	export default {
		data() {
			return {
				testlist: [],
				showInfor1: [],
				info:{},
				info1:{}
			}
		},

		onShow() {
			let showInfor = uni.getStorageSync("showInfor");
			console.log(showInfor);

			this.showInfor1 = showInfor

			console.log(this.showInfor1);
		},

		async onLoad() {

			let res = await theatretimes({
				//看电影 查询影片场次列表
				movieId: 3
			})
			// this.cinemalist = res.rows
			console.log(res);
		
			if (res.code == 200) {
				this.testlist = res.rows[0]
				console.log(this.testlist);
			} else {
			
				this.testlist = moviesessions().rows[0];
				console.log(this.testlist);
			
			}
			
			let res1 = await filmdetail(3)
			console.log(res1);
			// let data = res1.data;
			// this.info = data;
			
			if (res1.code == 200) {
			
				let data = res.data;
				this.info = data;
			} else {
			
				let data = moviedetails().rows[0];
				console.log(data);
				this.info = data;
				console.log(this.info);
			}
			
			let res2 = await moviedetail(3)
			//看电影 获取影院信息详细信息
			console.log(res2);
			
		if (res2.code == 200) {
				// this.cinemalist = res1.rows;
				let data1 = res2.data;
				this.info1 = data1;
			} else {

				let data1 = moviecinema().rows[0];
				this.info1 = data1;
				console.log(this.info1);

			}

		},


		methods: {

             gotomoviepay(){
				 uni.navigateTo({
					url:"/pages/movie/moviepay/moviepay"
				 })
			 }

		}
	}
</script>

<style>
	page {
		background-color: #F4F5F7;
	}

	.amount {
		text-align: center;
		padding-top: 80rpx;
		color: #FE602B;
		font-size: 72rpx;
		font-weight: 550;
	}

	.amount text {
		font-size: 36rpx;
	}

	.pay-tips {
		text-align: center;
		color: #636775;
		font-size: 28rpx;
		margin-top: 6rpx;
	}

	.pay-info-item {
		margin: 70rpx 32rpx 0rpx 32rpx;
		background-color: #FFFFFF;
		border-radius: 20rpx;
		padding: 40rpx 32rpx;
	}

	.film-title {
		color: #ff0000;
		font-size: 16px;
		font-weight: 600;
		text-align: center;
		
		padding-bottom: 8rpx;
	}

	.film-text {
		margin-top: 12rpx;
		color: #636775;
		font-size: 28rpx;
	}


	.pay-item {
		margin: 20rpx 25rpx 0rpx 25rpx;
		background-color: #FFFFFF;
		border-radius: 16rpx;
		padding: 26rpx 32rpx;
		display: flex;
		align-items: center;
	}

	.item-left {
		display: flex;
		align-items: center;
	}

	.item-left image {
		width: 48rpx;
		height: 48rpx;
	}

	.item-left text {
		color: #2D3039;
		font-size: 28rpx;
		margin-left: 20rpx;
	}

	.pay-check {
		margin-left: auto;
		width: 36rpx;
		height: 36rpx;
	}


	.pay-btns {
		position: fixed;
		bottom: 10rpx;
		left: 32rpx;
		right: 32rpx;
		height: 100rpx;
		line-height: 100rpx;
		text-align: center;
		background-color: #FE602B;
		border-radius: 50rpx;
		color: #FFFFFF;
		font-size: 36rpx;
		font-weight: 550;
	}
</style>